package com.lazily.homework;


/**
 * @Author:  GZQ
 * @date:  2025/2/20 23:20
 * @description: 练习1 --- 静态变量访问
 */

public class Homework01 {

    // 程序入口
    public static void main(String[] args) {
        Car c = new Car();
        Car c1 = new Car(100);
        System.out.println(c); // 9.0 red
        System.out.println(c1);// 100.0 white
    }
}

class Car {
    double price = 10;
    static String color = "white";

    @Override
    public String toString() {
        return price + "\t" + color;
    }

    public Car() {
        this.price = 9;
        this.color = "red";
    }

    public Car(double price) {
        this.price = price;
    }
}
